import { Character } from './Character';

export class Team {
    name: string;
    members: Character[];

    constructor(name: string, members: Character[]) {
        this.name = name;
        this.members = members;
    }

    isDefeated(): boolean {
        return this.members.every(member => !member.isAlive());
    }

    getAliveMembers(): Character[] {
        return this.members.filter(member => member.isAlive());
    }
}